home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
Shareware Overload Trio 2
/
Shareware Overload Trio Volume 2 (Chestnut CD-ROM).ISO
/
dir37
/
mxmnu241.zip
/
LOGIN.MNU
< prev
next >
Wrap
Text File
|
1993-01-26
|
23KB
|
953 lines
Comment
========================================================
Copyright 1990-92 by Marc Perkel * All right reserved.
MarxMenu now allows you to login to a Novell network without using
Novell's login program or messing with nasty login scripts. You can
be in MarxMenu all the way in.
Before you start on this make sure you have read the Novell section of
the MarxMenu manual. This menu is somewhat tricky and requires some
study before you dive right in.
Logging into Novell is tricky. Especially if you are using boot roms
on your network cards. Through much trial and error, I have found
some solid tricks that make life easier.
You should have the following two BATCH files in your LOGIN
directory as follows:
LOADNET.BAT ;if used with BESTNET
-----------
@Echo Off
%NET%
%NETD%
Set NET=
Set NETD=
Startup
LOADNET.BAT ;if not used with BESTNET
-----------
@Echo Off
NETX
F:
Startup
STARTUP.BAT
-----------
SET BOOTUP=LOGIN
MarxMenu Login
%BOOTUP%
Each workstation should have their own AUTOEXEC.BAT. The last line
should be LOADNET. If you are running multiple versions of dos or a
variety of computers you should run BESTNET as part of your bootup
sequence.
Also, if you want automatic login you can add the following lines to you
AUTOEXEC.BAT file:
SET USERNAME=MARC Your Name Here
SET PASSWORD=NERD Your Password Here
You should also change the COMSPEC= to the network command.com BEFORE
you run NETX. For some unknown reason, this solves a lot of problems.
Example:
IPX
SET COMSPEC=O:COMMAMD.COM
NETX
Another boot rom quirk is that you can't run any program off a boot
rom that trashes upper memory. An example is running QEMM on a
monochrome monitor.
By using this method the boot disk or boot rom hands control over in
a clean way. LOADNET.BAT then branches to STARTUP.BAT for the rest
of the login sequence.
For some strange reason which I can't explain, LOADNET and STARTUP
have to be two separate batch files. I think it forces the transient
part of COMMAND.COM to load into memory. Anyhow, don't combine these
into one batch file
The first line of STARTUP.BAT is a message that tells this menu that
the user is logging in for the first time. This menu creates a batch
file and puts the name of it in the environment variable BOOTUP.
STARTUP.BAT then executes this file.
This is the example for MY network. You'll have to modify it for
yours. I'm doing a lot of tricky things in my login. Your login might
not need to be as complex as mine.
One word of caution. After modifing this menu, always run MARXCOMP
LOGIN to compile it. Otherwise, if you boot up into it you won't
have enough access rights to recompile automatically. I do this by
making a file called L.BAT.
ME LOGIN.MNU
MARXCOMP LOGIN.MNU
========================================================
EndComment
var
UserName
OldPass
NewPass
Logged
Station
SmartDir
MyServer
OrigServer
HomeDir
DosDir
Shell
Vols
PasswordExpDays
SkipError
Servers
StatusWin
TsrLoaded
DrDos6
MyGroups
Comment
========================================================
If you are using 386 NetWare then make sure you copy the program
SUBLOGIN.EXE to the LOGIN directory. This will allow you to do encrypted
logins. Or you can run:
SET ALLOW UNENCRYPTED PASSWORDS = ON
========================================================
EndComment
Shell = CleanFileName(%COMSPEC%)
MyServer = NovDefaultServer
OrigServer = MyServer
NovServers(Servers)
Logged = %LOGGED% = 'TRUE'
SkipError = False
TryAutoLogin ;login using environment variables
if not Logged then LoginFromScreen
NovSetPrimaryServer (MyServer)
NovSetPreferredServer (MyServer)
NovReadGroups(UserName,MyGroups) ;Read Groups user is in.
SortArray(MyGroups)
UserName = NovLoginName
%LOGGED% = ''
%USERNAME% = UserName
%PASSWORD% = ''
;----- Another Server Selected
if MyServer <> OrigServer
%BOOTUP% = 'STARTUP'
%LOGGED% = 'TRUE'
NovMapDrive('F',MyServer + '/SYS:LOGIN')
ChDir('F:\LOGIN')
ExitMenu
endif
;----- You can't assume that you have an F: drive unless you map it.
NovMapDrive ('F','SYS:LOGIN')
Comment
========================================================
If a TEMP environment variable is set, MarxMenu will use it for
temporary batch files. This is compatible with DOS 5 and Windows
conventions. The users should be given full access rights to this
directory. I'm using \TMPFILES for my network.
========================================================
EndComment
if ExistDir('F:\TMPFILES') then %TEMP% = 'F:\TMPFILES'
;----- Here we calculate a home directory for each user.
HomeDir = 'SYS:HOME\' + UserName
if UserName = 'SUPERVISOR' then HomeDir = 'SYS:SYSTEM'
if not ExistDir(HomeDir) then HomeDir = 'SYS:PUBLIC\UTIL'
Comment
========================================================
Here we calulate the the name of the dos directory that matches the
version of dos we are running. The directory for DOS 5.0 would be
SYS:PUBLIC\DOSV5.00
========================================================
EndComment
DosDir = 'SYS:PUBLIC\DOSV' + DosVersionString
;----- DR DOS (NovOS)
if %OS% > ''
DosDir = 'SYS:PUBLIC\' + %OS% + %VER%
DrDos6 = Value(%VER%) >= 6
if DrDos6
Bat('SHARE.EXE')
endif
endif
if not ExistDir(DosDir) then DosDir = ''
Comment
========================================================
Here's where we map our drives. This does not set the search path.
You set that explicitly by writing to the PATH environment variable.
SYS:--+---PUBLIC---NSK
| |
| +------UTIL
| |
| +------DOSV5.00
| |
| +------DRDOS6.0
|
+---HOME-----MARC
| |
| +------VICKI
|
+---LOGIN
Drive map commands may contain server and volume referrences:
========================================================
EndComment
NovMapRoot ('H', HomeDir) ;Home Directory
NovMapRoot ('N','SYS:PUBLIC\NSK') ;Network Survival Kit
NovMapRoot ('O', DosDir) ;Dos Directory
NovMapRoot ('U','SYS:PUBLIC\UTIL') ;Utilities Directory
NovMapRoot ('P','SYS:PUBLIC') ;Public Directory
NovMapRoot ('L','SYS:LOGIN') ;Login Directory
Comment
========================================================
Here we set a different directory for a program depending on if we
have a color or monochrome monitor.
========================================================
EndComment
if VideoMode = Mono
SmartDir = 'SYS:PUBLIC\MSMART'
else
SmartDir = 'SYS:PUBLIC\CSMART'
endif
if ExistDir SmartDir
NovMapRoot ('S',SmartDir)
endif
Comment
========================================================
W: is a work drive. When an application needs an extra search path, I
move W: to that directory.
OnKey 'L'
|NovMapRoot('W','\PUBLIC\LOTUS')
Lotus
========================================================
EndComment
NovMapRoot('W','H:')
if NovConsoleOperator
NovMapRoot ('V','F:\SYSTEM') ;System Directory
endif
if MyServer = 'TYME'
;----- Here's where I log into a second server.
if PosInList('SHOW',Servers) > 0
NovLogin('SHOW/' + UserName,OldPass)
NovMapDrive('K','SHOW/SYS:')
endif
;----- Here's where I log into a third server.
if PosInList('TSS',Servers) > 0
NovLogin('TSS/' + UserName,OldPass)
NovMapDrive('J','TSS/SYS:')
endif
;----- Here's where I log into another server.
if PosInList('MARX',Servers) > 0
NovLogin('MARX/' + UserName,OldPass)
NovMapDrive('G','MARX/SYS:')
endif
endif
NovVolumes(Vols)
if PosInList('VOL1',Vols) > 0 then NovMapDrive ('I','VOL1:')
;----- Turbo Pascal 6
if ExistDir ('H:\BP7') then NovMapRoot ('T','H:\BP7\BIN')
;----- If no drive C then use home directory
if Floppies < 3 ;I'm using some 4 floppy machines
if not ExistDir ('C:\') then NovMapRoot('C','H:')
endif
;----- Here we define our search paths.
%PATH% = 'T:\;H:\;W:\;U:\;N:\;O:\;P:\;V:\;S:\;'
FixPath ;Verifies all search paths exist
ChDir 'F:'
ChDir (HomeDir)
;----- Here's where we set master environment variable strings
%STATION% = Station
if Left(Shell,2) <> 'C:' and ExistFile('O:\COMMAND.COM')
%COMSPEC% = 'O:\COMMAND.COM'
endif
%PROMPT% = '$e[1;33m$p: $e[0;32m' ;ansi required
%MXECHO% = 'OFF'
%MV% = MyServer + '/SYS:' ;MHS
;----- Check for personal menu.
if ExistFile('H:\' + UserName + '.MNU')
%PMENU% = UserName + '.MNU'
endif
;----- Here's where I set up for Pick Directory
if UserName <> 'MARC'
SetEnv('PD.EXE=/$F:\HOME\PD.PIC')
else
SetEnv('PD.EXE=/$H:\PD.PIC')
endif
Comment
========================================================
Opens a semaphore that XMETER can read.
To see how many users are users are on with XMETER type:
XMETER LOGIN /U
=====================================}==================
EndComment
NovOpenSemaphore ('XM-LOGIN',0)
;----- Turn NumLock key on if in NumLock group.
if InGroup('NUMLOCK')
NumLock On
else
NumLock Off
endif
;----- LOGIN is set to BOOTUP if logging in for the first time
if UpperCase(%BOOTUP%) <> 'LOGN' then ExitMenu
Comment
========================================================
In order to load TSRs, MarxMenu writes a temporary batch file and
exits. The STARTUP.BAT file then jumps to this batch file.
========================================================
EndComment
;----- Create temporary batch file for rest of login sequence
%BOOTUP% = BatFileName
;----- To debug, set ECHO ON and add PAUSE commands
;Bat ('ECHO ON')
Bat ('SET BOOTUP=') ;clear BOOTUP environment variable
;----- Set BREAK to ON if NovConsoleOperator
if NovConsoleOperator then Bat('BREAK ON')
Comment
========================================================
Here's where we load up all the TSRs the user is going to use. We set
the environment variable TSR to Y to indicate that TSRs are loaded. This
way if we log out and then back in we won't load them twice.
========================================================
EndComment
TsrLoaded = %TSR% = 'Y'
if not TsrLoaded
%TSR% = 'Y'
;----- Load Task Switch Support
if InGroup ('TASKMAX')
; Bat (LoadHigh + 'TBMI2')
endif
;----- Load Mouse
if InGroup ('MOUSE')
Bat (LoadHigh + 'P:\WINDOWS\MOUSE')
endif
;----- Load CastAway
if InGroup ('CASTAWAY')
Bat ('P:\EXPR\CASTAWAY N /W=0 /I=0 /H')
endif
;----- Load BRequest
if InGroup ('BREQ')
Bat (LoadHigh + 'BREQUEST')
Bat (LoadHigh + 'P:\SQL\NSREQ')
endif
;----- Load ExpressIT Mail System
if InGroup ('EXPRESSIT')
Bat ('P:\EXPR\EXPRESSM F12')
endif
;----- Load Lan Assist
if InGroup ('LANASSIST')
if InGroup ('LA-RES')
Bat (LoadHigh + 'P:LA\LA /L >NUL')
else
Bat (LoadHigh + 'P:LA\LA +N >NUL')
endif
endif
;----- Load SideKick if in Sidekick Group
if InGroup('SIDEKICK')
Bat ('KBD CR')
Bat (LoadHigh + 'SWAPSK/N/G/DH:\ >NUL')
Bat ('SK')
Bat ('CLS')
endif
;----- Load SideKick 2 if in SK2 Group
if (InGroup('SK2')) and not DrDos6
Bat (LoadHigh + 'P:\SK2\SK2')
endif
;----- Load MarxPop
if InGroup('MARXPOP') and not DrDos6
Bat('MarxPop H:MarxPop.cfg')
endif
endif
Capture('LASER',2)
Comment
================================================================
This next section deals with running special programs bases on the
physical station number rather than by user. This deals with special
hardware that needs software drivers loaded.
================================================================
EndComment
;----- CD ROM Machine
;if NovStationAddress = '255:2'
; Bat ('CD\PUBLIC\MA')
; Bat ('MSCDEX.EXE /D:MSCD003 /M:12')
; Bat ('MAR C:\ RW=/ /C')
;endif
if NovStationAddress = '254:93'
; TextMode Mono
endif
comment
if NovStationAddress = '254:B8'
if (%REST% <> "ON") and (UserName <> "MARC")
clearscreen
writeln "Access Denied! Try another workstation."
wait 60000
endif
endif
endcomment
;----- Set Keyboard Speed Faster if 286 or greater.
if CPUClass > 1 then Bat('KBD 6')
Comment
================================================================
This next section deals with running special programs bases on the
users preferrences.
================================================================
EndComment
if UserName = 'MARC'
Capture('DOT',1)
ChDir('BP7\MARX')
endif
if UserName = 'VICKI'
; if not TsrLoaded then Bat(LoadHigh + 'MOUSE')
Bat (LoadHigh + 'P:\SK2\SK2')
endif
;---- Map \home\phil\batch as drive 'Q' for user Phil
if UserName = 'PHIL'
NovMapRoot('Q','f:\home\phil\batch')
%PATH% = 'Q:\;T:\;H:\;W:\;U:\;N:\;O:\;P:\;V:\;S:\;'
FixPath ;Verifies all search paths exist
endif
if UserName = 'KEVIN'
Capture('DOT',2)
%PROMPT% = '($p)'
%PATH% = %PATH% + 'f:\home\kevin\brief'
ChDir('MARX')
endif
if UserName = '386'
Capture('DOT',1)
endif
if UserName = 'TSS'
NovMapDrive('G','F:')
%BOOTUP% = '\LOGIN\TSS.BAT'
exitmenu
endif
if InGroup('BBS')
Capture('DOT',1)
NovMapRoot('W','F:\BBS\FAXPAK')
NovMapRoot('V','F:\BBS')
%FAXDIR% = 'C:\FAX'
SetEnv('D.EXE=/O/I')
Bat('CD FAX')
Bat('CASMGR CASMGR.CFG')
; Bat('Ringboot /C1 /R4')
Bat('DROPTO S')
endif
if UserName = 'WORK'
Capture('DOT',1)
endif
if UserName = 'MHS'
Capture('DOT',1)
ChDir('F:\MHS\EXE')
NovMapDrive('H','F:')
Bat('MHSNOTFY')
Bat('MHSRESET')
Bat('DROPTO MHS')
endif
Comment
================================================================
The batch file ends by jumping to personal menu, if there is one, or
the default menu if there isn't. DROPTO.BAT is used to erase the
temporary batch file that this menu creates.
TMAX.BAT
--------
taskmax /f
marxmenu novmax
dolist
================================================================
EndComment
if DrDos6 and InGroup('TASKMAX')
Bat ('DROPTO TMAX.BAT')
endif
if ExistFile ('F:\HOME\' + UserName + '\' + UserName + '.MNU')
Bat ('DROPTO MARX ' + UserName)
endif
Bat ('DROPTO MARX TYME')
ExitMenu
;===============================================================
;===============================================================
;----- Procedure Definitions
Procedure Capture (Queue, PrinterPort)
NovCaptureQueue(PrinterPort) = Queue
NovCaptureTimeOut(PrinterPort) = 5 ;5 second timeout
EndProc
Procedure LoadHigh
if %OS2% = 'Y'
Return 'LOADHIGH '
else
Return 'P:\QEMM\LOADHI.COM '
endif
EndProc
Comment
========================================================
If Environment variables USERNAME and PASSWORD are set, this menu
will attempt to log into the network using these values. This allows
for automatic login. You can also pass the parameters on the command
line as follows.
MarxMenu Login <Name> <Password>
The name may contain a referrence to a server: Server/Name
========================================================
EndComment
;----- Try Automatic Login using Environment Variables
Procedure TryAutoLogin
if Logged then Return
if CapsLock
CapsLock Off
else
UserName = ParamStr(2)
if UserName = '' then UserName = %USERNAME%
if UserName > ''
OldPass = ParamStr(3)
if OldPass = '' then OldPass = %PASSWORD%
SkipError = True
Login (UserName,OldPass)
SkipError = False
if PasswordNeedsChanged
Logged = False
Suggest 'C'
endif
endif
endif
EndProc
;----- Select colors and prepare screen
Procedure LoginFromScreen
if ColorScreen
TextColor White Red
BoxBorderColor Green Brown
BoxInsideColor Black Brown
ClearScreen 176
ClockColor Black Brown
TextColor Black Green
BoxHeaderColor Yellow Mag
Shadow
else
TextColor Grey Black
ClearScreen 176
TextColor Black Grey
BoxBorderColor Black Grey
BoxInsideColor Black Grey
BoxHeaderColor Black Grey
ClockColor Black Grey
endif
BlankMessage = 'Netware Login'
ClockMode = 262
GotoXY 1 25
ClearLine
WriteCenter "Computer Tyme Master Network Login Menu"
SingleLineBox
Explode Off
ShadowColor Grey Red
if ColorScreen
DrawBox 3 2 74 5
ClockPos 42 5
TextColor Blue Brown
else
DrawBox 3 2 76 5
ClockPos 44 5
endif
WriteCenter 'Computer Tyme Software Development Laboratory'
Writeln
TextColor Black Brown
WriteCenter '───────────────────────────────────────────────────────'
Writeln
TextColor Black Brown
Write " (C) 1990-92 by Marc Perkel"
DoubleLineBox
BlankTime = 10
Explode On
BlockBox
BoxBorderColor Green Blue
BoxInsideColor Yellow Blue
BoxHeader = " Station Information "
if ColorScreen
DrawBox 39 17 38 6
TextColor Yellow Blue
else
DrawBox 41 17 38 6
TextColor Grey Black
endif
StatusWin = CurrentWindow
UpdateStatusWindow
ChooseOption
EraseTopWindow
EraseTopWindow
EraseTopWindow
TextColor Grey Black
ClearScreen
EndProc
Procedure ChooseOption
var Ch X
repeat
X = 4
if NumberOfElements(Servers) > 1 then X = 5
DrawBox 3 17 26 X
UseArrows
OnScreenOnly
InverseColor Yellow Cyan
Writeln ' L - Login to Network'
Write ' C - Change Password'
if NumberOfElements(Servers) > 1
Writeln
Write ' S - Select Server'
endif
Ch = UpperCase(ReadKey)
if (Ch = 'L') or (Ch = 'C') or (Ch = 'S')
EraseTopWindow
if Ch = 'L'
LoginToNetwork (False)
endif
if Ch = 'C'
LoginToNetwork (True)
endif
if Ch = 'S'
SelectServer
endif
endif
until Logged
EndProc
Procedure Warning (St)
BoxHeader ' Warning '
DrawBox 3 17 length(St) + 4 3
Write Char(7) ' ' St
Wait 300
EraseTopWindow
EndProc
Procedure LoginToNetwork (CP)
var NewPassVerify
BoxHeader = ' Logging into Server * ' + MyServer + ' '
DrawBox 3 10 50 4
UseArrows Off
Security
repeat
if UserName = ''
Write ' Name: '
UserName = UpperCase(Readln)
Writeln
endif
SkipError = True
Login (UserName,'') ;try no password
SkipError = False
if not Logged
Write ' Password: '
OldPass = UpperCase(Readln)
Write CR
ClearLine
Login (UserName,OldPass)
endif
if not CP
CP = PasswordNeedsChanged
if CP then Warning('Time to change your password!')
endif
if CP
if LastKey <> Esc
repeat
Write ' New Password: '
NewPass = UpperCase(Readln)
Write CR
ClearLine
if NewPass = OldPass then Warning('Select a NEW Password!')
until NewPass <> OldPass
endif
if LastKey <> Esc
Write ' Verify: '
NewPassVerify = UpperCase(Readln)
Write CR
ClearLine
if NewPass = NewPassVerify
NovChangePassword (OldPass,NewPass)
if NovResult <> 0
Warning ('Password Change Failed!')
Logged = False
endif
else
Warning('Password Typed Wrong!')
Logged = False
endif
endif
endif
ClearScreen
if not Logged
UserName = ''
endif
until (LastKey = Esc) or Logged
EraseTopWindow
EndProc
Procedure Login (User, Pass)
NovLogin (MyServer + '/' + User, Pass)
if NovResult = 223 then NovResult = 0 ;grace login
Logged = NovResult = 0
if Logged
NovMapDrive('F',MyServer + '/SYS:LOGIN')
endif
if not Logged and not SkipError
if NovResult = 254
Warning('All Logins Disabled!')
elseif NovResult = 222
Warning('Password Expired!')
elseif NovResult = 252
Warning('Invalid User Name!')
elseif NovResult = 220
Warning('Account Disabled!')
elseif (NovResult = 218) or (NovResult = 219)
Warning('Invalid Login Time!')
elseif NovResult = 197
Warning('Intruder Lockout!')
elseif NovResult = 214
Warning('Requires Encrypted Password!')
elseif NovResult = 255
Warning('Bad Password!')
else
Warning('Login Failed! '+ Str(NovResult))
endif
endif
EndProc
Procedure PasswordNeedsChanged
var X
X = NovPasswordExpDate (UserName)
if X = 0 then Return False
Return (X - Today) / SecondsInDay <= 5
EndProc
Procedure SelectServer
var St
DrawBox 25 9 20 Min(NumberOfElements (Servers) + 2,10)
St = PickOne (Servers)
if St = '' then Return
MyServer = St
NovSetPrimaryServer (MyServer)
NovSetPreferredServer (MyServer)
EraseTopWindow
UpdateStatusWindow
EndProc
Procedure UpdateStatusWindow
SetTopWindow StatusWin
ClearScreen
Station = Str(NovConnection)
while length(Station) < 3
Station = '0' + Station
endwhile
Writeln ' Server: ' MyServer
Writeln ' Network: ' NovStationAddress
Writeln ' Connection: ' Station
Write ' DOS Version: ' DosVersionString
if StatusWin <> CurrentWindow
SetWindowUnder (StatusWin,StatusWin + 1)
endif
EndProc
;----- Returns True if in list
Procedure InGroup (Group)
Return PosInSortedList(UpperCase(Group),MyGroups) > 0
EndProc
;----- Return True if after hours
Procedure AfterHours
Return (DayOfWeek = Sun) or (DayOfWeek = Sat) or (Hour > 17) or (Hour < 7)
EndProc
;----- Show Item for Debugging
Procedure ShowMe (Item)
DrawBox 1 23 80 3
Write ' '
TextColor Yellow Cyan
Write Item
Wait 300
EraseTopWindow
EndProc